<?php

namespace Database\Seeders;

use App\Models\Admin\SysMenu;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class SysMenuSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $menu = SysMenu::create([
            'name' => '/system',
            'path' => '/system',
            'component' => 'Layout',
            'redirect' => '/system/user',
            'meta' => [
                "title" => "系统管理",
                "icon" => "system",
                "hidden" => false,
                "roles" => [
                    "ADMIN"
                ]
            ],
        ]);


        $menu->children()->createMany([
            [
                'name' => 'User',
                'path' => 'user',
                'component' => 'system/user/index',
                // 'redirect' => '/system/user',
                'meta' => [
                    "title" => "用户管理",
                    "icon" => "user",
                    "hidden" => false,
                    "roles" => [
                        "ADMIN"
                    ],
                    "keepalive" => true
                ],
            ],
            [
                'name' => 'Role',
                'path' => 'role',
                'component' => 'system/role/index',
                // 'redirect' => '/system/role',
                'meta' => [
                    "title" => "角色管理",
                    "icon" => "role",
                    "hidden" => false,
                    "roles" => [
                        "ADMIN"
                    ],
                    "keepalive" => true
                ],
            ],
            [
                'name' => 'Menu',
                'path' => 'menu',
                'component' => 'system/menu/index',
                // 'redirect' => '/system/role',
                'meta' => [
                    "title" => "菜单管理",
                    "icon" => "menu",
                    "hidden" => false,
                    "roles" => [
                        "ADMIN"
                    ],
                    "keepalive" => true
                ],
            ],
            [
                'name' => 'Dict',
                'path' => 'dict',
                'component' => 'system/dict/index',
                // 'redirect' => '/system/role',
                'meta' => [
                    "title" => "字典管理",
                    "icon" => "dict",
                    "hidden" => false,
                    "roles" => [
                        "ADMIN"
                    ],
                    "keepalive" => true
                ],
            ],
        ]);


        $menu = SysMenu::create([
            'name' => '/debug',
            'path' => '/debug',
            'component' => 'Layout',
            'redirect' => '/debug/list',
            'meta' => [
                "title" => "调试页面",
                "icon" => "system",
                "hidden" => false,
                "roles" => [
                    "ADMIN"
                ]
            ],
        ]);

        $menu->children()->createMany([
            [
                'name' => 'List',
                'path' => 'list',
                'component' => 'debug/list/index',
                // 'redirect' => '/system/user',
                'meta' => [
                    "title" => "列表页面",
                    "icon" => "user",
                    "hidden" => false,
                    "roles" => [
                        "ADMIN"
                    ],
                    "keepalive" => true
                ],
            ],

            [
                'name' => 'Table',
                'path' => 'table',
                'component' => 'debug/table/index',
                // 'redirect' => '/system/user',
                'meta' => [
                    "title" => "表格",
                    "icon" => "user",
                    "hidden" => false,
                    "roles" => [
                        "ADMIN"
                    ],
                    "keepalive" => true
                ],
            ],
        ]);
        // foreach($menus as $menu) {
        //     SysMenu::create();

        // }
    }
}
